package com.venutech.gongan.api;


import com.venutech.gongan.service.ITbWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@EnableScheduling
@EnableAsync
public class ScheduledTasksController {

    @Autowired
    ITbWorkService tbWorkService;
    /**
     * 每隔4小时巡检1次
     * @return
     */
    @Async
    @Scheduled(cron = "0 0 3,7,11,15,19,23 * * ?")
    public void  regularInspection(){
        tbWorkService.regularInspection();
    }

//    @Async
//    @Scheduled(cron = "*/5 * * * * ?")
//    public void  cleanRegularTimePosition(){
//        System.out.println("5秒");
//    }
}
